package com.damie.exception;


import com.damie.utils.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ResponseBody
    @ExceptionHandler(MyException.class)
    public Result myException(MyException e){
        e.printStackTrace();
        return Result.fail("请求错误");
    }
}
